# encoding:utf-8
import os.path

SITE_SRC_ROOT = os.path.dirname(__file__)
LOG_FILENAME = 'django.osqa.log'

#for logging
import logging
logging.basicConfig(
    filename=os.path.join(SITE_SRC_ROOT, 'log', LOG_FILENAME),
    level=logging.ERROR,
    format='%(pathname)s TIME: %(asctime)s MSG: %(filename)s:%(funcName)s:%(lineno)d %(message)s',
)

#ADMINS and MANAGERS
ADMINS = ()
MANAGERS = ADMINS

DEBUG =False #True
DEBUG_TOOLBAR_CONFIG = {
    'INTERCEPT_REDIRECTS': True
}
TEMPLATE_DEBUG = DEBUG
INTERNAL_IPS = ('127.0.0.1',)


DATABASE_NAME = 'hktuncom_guru4us'             # Or path to database file if using sqlite3.
DATABASE_USER = 'hktuncom_hne'               # Not used with sqlite3.
DATABASE_PASSWORD = 'xkh.ua'               # Not used with sqlite3.
DATABASE_ENGINE = 'mysql'  #mysql, etc
DATABASE_HOST = 'localhost'
DATABASE_PORT = '3306'

#SERVER_EMAIL = 'localhost'
#DEFAULT_FROM_EMAIL = 'guru4us_sub@hktun.com'
#EMAIL_HOST_USER = 'guru4us_sub'
#EMAIL_HOST_PASSWORD = 'xkh.ua' #not necessary if mailserver is run on local machine
#EMAIL_SUBJECT_PREFIX = 'guru4us subscription '
#EMAIL_HOST='mai.hktun.com'
#EMAIL_PORT='26'
#EMAIL_USE_TLS=False


CACHE_BACKEND = 'file://%s' % os.path.join(os.path.dirname(__file__),'cache').replace('\\','/')
#CACHE_BACKEND = 'dummy://'
SESSION_ENGINE = 'django.contrib.sessions.backends.db'

APP_URL = 'http://www.guru4us.com' #used by email notif system and RSS

#LOCALIZATIONS
TIME_ZONE = 'America/Chicago'

###########################
#
#   this will allow running your forum with url like http://site.com/forum
#
#   FORUM_SCRIPT_ALIAS = 'forum/'
#
FORUM_SCRIPT_ALIAS = '' #no leading slash, default = '' empty string


#OTHER SETTINGS

USE_I18N = True
LANGUAGE_CODE = 'en_us'

DJANGO_VERSION = 1.1
OSQA_DEFAULT_SKIN = 'default'

DISABLED_MODULES = ['books', 'recaptcha', 'project_badges']

#HNE Without below code, the log will keep on drop failure
#SPHINX_SEARCH_INDICES
USE_SPHINX_SEARCH = False
SPHINX_API_VERSION = 0x113 #refer to djangosphinx documentation
SPHINX_SEARCH_INDICES=('osqa',) #a tuple of index names remember about a comma after the
#last item, especially if you have just one :)
SPHINX_SERVER='localhost'
SPHINX_PORT=3312

